SYNC_DB

Use this command to start a synchronization. The following parameters are used with the SYNC_DB command:

  • ActionCodeSuccess: This action code will be executed, if the synchronization was successful.
  • ActionCodeFailure: This action code will be executed, if the synchronization fails or is aborted.
  • Parameter 3: Use this paramter to activates a background-synchronization – find additional information here
  • Parameter 4: This parameter can be defined as either of the following and is available in the App Events codeunit, function OnSyncRequest as variable SyncType. It activates a single-side sync from app to Dynamics only. Data will be processed in Dynamics after receiving, but the app is not waiting for a reply
    • SENDONLY: no call to the Anve Delta Server will be performed.
    • SENDONLY_CALCDELTA: will also start an Anveo Delta Server call after processing all data in Dynamics to speed-up following full synchronizations
    • SENDRECVONLY: If you select SENDONLY, SENDRECVONLY will send and receive data but won’t process the received data onto your device. The parameter
  • Parameter 5: Optional parameter that will be available in codeunit ACF App Events, in the function OnSyncRequest as variable SyncParameter

The last successful synchronization can be retrieved by th environment variable GETLASTSUCCESSSYNC();

This is an asynchronious call, you cannot continue your code after this call. It must be placed at the end of your action code. Any additional code after the synchronization must be placed in ActionCodeSuccess or ActionCodeFailure.

SYNC_DB(string ActionCodeSuccess,
        string ActionCodeFailure,
        '', 
        '',  
        string Parameter);

Send only synchronization:
SYNC_DB(string ActionCodeSuccess,
        string ActionCodeFailure, 
        ['' | 'SILENT'],
        ['SENDONLY'|'SENDONLY_CALCDELTA'|SENDRECVONLY'], 
        string SyncParameter);

example:
SYNC_DB();
 
SYNC_DB('SYNC_SUCCESS', 
        ''); 

SYNC_DB('SYNC_SUCCESS', 
        'SYNC_FAILURE');
 
SYNC_DB('', 
        '', 
        '', 
        'SENDONLY');

SYNC_DB('', 
        '', 
        '', 
        'SENDONLY', 
        'Info to App Events');

SYNC_DB('', 
        '', 
        'SILENT', 
        'SENDRECVONLY');